//package com.per.mybootall.config;
//
//
//import org.mybatis.logging.Logger;
//import org.mybatis.logging.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.PropertySource;
//
//import java.net.InetAddress;
//
//
//@PropertySource(value={"application.properties"})
//@Configuration
//public class ElasticSearchConfig {
//
//    private static final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchConfig.class);
//
//    /**
//     * elk集群地址
//     */
//    @Value("${elasticsearch.ip}")
//    private String hostName;
//
//    /**
//     * 端口
//     */
//    @Value("${elasticsearch.port}")
//    private String port;
//
//    /**
//     * 集群名称
//     */
//    @Value("${elasticsearch.cluster.name}")
//    private String clusterName;
//
//    /**
//     * 连接池
//     */
//    @Value("${elasticsearch.pool}")
//    private String poolSize;
////    @Autowired
////    private TransportClient transportClient;
//    /**
//     * Bean name default  函数名字
//     *
//     * @return
//     */
////    @Bean(name = "transportClient")
////    public TransportClient transportClient() {
////
////        TransportClient transportClient = null;
////
////            // 配置信息
////            Settings esSetting = Settings.builder()
////                    .put("cluster.name", clusterName) //集群名字
////                    .put("client.transport.sniff", true)//增加嗅探机制，找到ES集群
////                    .put("thread_pool.search.size", Integer.parseInt(poolSize))//增加线程池个数，暂时设为5
////                    .build();
////            //配置信息Settings自定义
////            transportClient = new PreBuiltTransportClient(esSetting);
////            TransportAddress transportAddress = new TransportAddress(InetAddress.getByName(hostName), Integer.valueOf(port));
////            transportClient.addTransportAddresses(transportAddress);
////
////        return transportClient;
////    }
//}
